<?php
/**
 * Vista que muestra una tabla con los documentos que le pasen por el párametro
 * $files
 *
 * @author Israel Mora e Ismael Garcia
 */
?>
<table id="tabla-normal">
    <tr>
		<th><input type="button" value="New" onClick="javascript:getData('<?php echo $new; ?>','<?php echo $capa; ?>')"></th>
		<th><?php echo(_("Título")); ?></th>
                <th><?php echo(_("Aprobado")); ?></th>
                <th><?php echo(_("Descargar")); ?></th>
    </tr>
	<?php 
		foreach($files as $fila){ 
	?> 
    <tr>  
		<td>
			<a href="#" title="show" onclick="javascript:getData('<?php echo $show; ?>&id=<?php echo $fila["id"]; ?>','<?php echo $capa; ?>');">
			    <img src="img/hide.gif" border=0 />
			</a>
			<a href="#" title="edit" onclick="javascript:getData('<?php echo $edit; ?>&id=<?php echo $fila["id"]; ?>','<?php echo $capa; ?>');">
			    <img src="img/edit.gif" border=0 />
			</a>
			<a href="#" title="delete" onclick="javascript:if(confirm('Seguro que deseas eliminar el archivo: \n<?php echo $fila["titol"];  ?> ')) getData('<?php echo $delete; ?>&id=<?php echo $fila["id"]; ?>','<?php echo $capa; ?>');">
			    <img src="img/delete.gif" border=0 />
			</a>
		</td>
        <td><?php echo $fila["titol"]; ?></td>
        <?php
            if($fila["aprovat"]==0){
        ?>
            <td><input type="checkbox" name="aprovat" value="<?php echo $fila["aprovat"] ?>"  onchange="javascript:getData('<?php echo $check; ?>&id=<?php echo $fila["id"]; ?>&value=<?php echo $fila["aprovat"] ?>','<?php echo $capa; ?>');"></td>
        <?php
            }else{
        ?>
            <td><input type="checkbox" checked="" name="aprovat" value="<?php echo $fila["aprovat"] ?>"  onchange="javascript:getData('<?php echo $check; ?>&id=<?php echo $fila["id"]; ?>&value=<?php echo $fila["aprovat"] ?>','<?php echo $capa; ?>');"></td>
        <?php
            }
        ?>
        <td> <a href="#" title="label" onclick="javascript:getData('<?php echo $asign; ?>&id=<?php echo $fila["id"]; ?>','<?php echo $capa; ?>');">
			    <img src="img/label.png" border=0 />
			</a>
            <a title="download" href="<?php echo $download; ?>&id=<?php echo $fila["id"]; ?>">
		<img src="img/download.png" border=0  />
            </a>
            <a> 
                
            </a>
        
    </tr>
	<?php } ?>
</table>
